import request from "../utils/request";
type API<T = any> = (...args: T[]) => Promise<any>
//获取角色数据
export const getRoleApi = (query?:any) => {
    return request('/role', {
        method: 'get',
        query
    })
}
//新增角色数据
export const addRole = (body:any) => {
    return request('/role', {
        method: 'post',
        body
    })
}
//修改角色数据
export const updateRole = (body:any) => {
    return request('/role', {
        method: 'put',
        body
    })
}
//删除角色
export const delRoleApi: API = (roleId:any) => {
    return request(`/role/${roleId}`, {
        method:'delete'
    })
}